<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=9" />
        <link href="style3.css" rel="stylesheet" type="text/css" />
        <title></title>
    </head>
    <body>
        <?php
        require_once "statics.php";
        echo '<h3>Reset your password</h3>';
        echo "<label>Email:</label>";
        echo "<input type='text' id='email' name='email' />";
        echo "<button id='submit_email' name='submit_email'>Submit</button><br />
            <br />
            <br />
            <br />";
        echo '<a href="signIn2.php"><< Back</a>';
        ?>
        <?php include "jquery.php";?>
        <script type="text/javascript">
            //<![CDATA[
            $(document).ready(function()
            {
                $("#submit_email").bind("click",function()
                {
                    $(this).attr("disabled", "disabled");
                    $.ajax({
                        type:"GET",
                        url: "forgetPasswordServer.php",
                        data:{check_email:$("#email").val()},
                        success:function(response)
                        {
                            if(response=="1")
                            {
                                alert("Please check your email for a message that will tell you your newly generated password");
                                window.location="signIn2.php";
                            }
                            else if(response=="0")
                            {
                                alert("The email you entered is not found in our database please check it for errors");
                            }
                            else
                            {
                                alert(response);
                            }
                            $("#submit_email").removeAttr("disabled");
                        }
                    });
                });
            });
            //]]>
        </script>
    </body>
</html>
